﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Api.Filter
{
    public class Action2 : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            if (!context.HttpContext.Items.ContainsKey("M_test"))
            {
                context.HttpContext.Items.Add("M_test", "");
            }
            context.HttpContext.Items["M_test"] = $"{context.HttpContext.Items["M_test"]} Action2 OnActionExecuting ";
            base.OnActionExecuting(context);
        }
        /// <summary>
        /// 执行结束执行
        /// </summary>
        /// <param name="context"></param>
        public override void OnActionExecuted(ActionExecutedContext context)
        {
            base.OnActionExecuted(context);
        }
    }
}
